/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.techshop.service.impl;

import com.techshop.dao.ImageDao;
import com.techshop.model.Image;
import com.techshop.service.ImageService;
import java.util.List;

/**
 *
 * @author Hai-PC
 */
public class ImageServiceImpl implements ImageService
{    
    private ImageDao imageDao;    

    @Override
    public boolean insert(Image image)
    {
        return this.getImageDao().insert(image);
    }

    @Override
    public boolean delete(Image image)
    {
        return this.getImageDao().delete(image);
    }

    /**
     * @return the imageDao
     */
    public ImageDao getImageDao()
    {
        return imageDao;
    }

    /**
     * @param imageDao the imageDao to set
     */
    public void setImageDao(ImageDao imageDao)
    {
        this.imageDao = imageDao;
    }

    @Override
    public List<Image> getByPhone(int phoneId, String category)
    {
        return imageDao.getByPhone(phoneId, category);
    }

    @Override
    public List<Image> getByPhoneAndColor(int phoneId, String colorId, String category)
    {
        return imageDao.getByPhoneAndColor(phoneId, colorId, category);
    }
}